3.77 \(\int \frac{\left (2-3 x+x^2\right ) \left (d+e x+f x^2+g x^3+h x^4\right )}{4-5 x^2+x^4} \, dx\)

Optimal. Leaf size=66 \[ \log (x+1) (d-e+f-g+h)-\log (x+2) (d-2 e+4 f-8 g+16 h)+x (f-3 g+7 h)+\frac{1}{2} x^2 (g-3 h)+\frac{h x^3}{3} \]

[Out]

(f - 3*g + 7*h)*x + ((g - 3*h)*x^2)/2 + (h*x^3)/3 + (d - e + f - g + h)*Log[1 +
x] - (d - 2*e + 4*f - 8*g + 16*h)*Log[2 + x]

_______________________________________________________________________________________

Rubi [A]  time = 0.172661, antiderivative size = 66, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 4, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.098 \[ \log (x+1) (d-e+f-g+h)-\log (x+2) (d-2 e+4 f-8 g+16 h)+x (f-3 g+7 h)+\frac{1}{2} x^2 (g-3 h)+\frac{h x^3}{3} \]

Antiderivative was successfully verified.

[In]  Int[((2 - 3*x + x^2)*(d + e*x + f*x^2 + g*x^3 + h*x^4))/(4 - 5*x^2 + x^4),x]

[Out]

(f - 3*g + 7*h)*x + ((g - 3*h)*x^2)/2 + (h*x^3)/3 + (d - e + f - g + h)*Log[1 +
x] - (d - 2*e + 4*f - 8*g + 16*h)*Log[2 + x]

_______________________________________________________________________________________

Rubi in Sympy [F]  time = 0., size = 0, normalized size = 0. \[ - 3 g x + \frac{h x^{3}}{3} + 7 h x + \left (g - 3 h\right ) \int x\, dx - \left (d - 2 e + 4 f - 8 g + 16 h\right ) \log{\left (x + 2 \right )} + \left (d - e + f - g + h\right ) \log{\left (x + 1 \right )} + \int f\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((x**2-3*x+2)*(h*x**4+g*x**3+f*x**2+e*x+d)/(x**4-5*x**2+4),x)

[Out]

-3*g*x + h*x**3/3 + 7*h*x + (g - 3*h)*Integral(x, x) - (d - 2*e + 4*f - 8*g + 16
*h)*log(x + 2) + (d - e + f - g + h)*log(x + 1) + Integral(f, x)

_______________________________________________________________________________________

Mathematica [A]  time = 0.0552303, size = 67, normalized size = 1.02 \[ \log (x+1) (d-e+f-g+h)+\log (x+2) (-d+2 e-4 f+8 g-16 h)+x (f-3 g+7 h)+\frac{1}{2} x^2 (g-3 h)+\frac{h x^3}{3} \]

Antiderivative was successfully verified.

[In]  Integrate[((2 - 3*x + x^2)*(d + e*x + f*x^2 + g*x^3 + h*x^4))/(4 - 5*x^2 + x^4),x]

[Out]

(f - 3*g + 7*h)*x + ((g - 3*h)*x^2)/2 + (h*x^3)/3 + (d - e + f - g + h)*Log[1 +
x] + (-d + 2*e - 4*f + 8*g - 16*h)*Log[2 + x]

_______________________________________________________________________________________

Maple [A]  time = 0.01, size = 98, normalized size = 1.5 \[{\frac{h{x}^{3}}{3}}+{\frac{g{x}^{2}}{2}}-{\frac{3\,h{x}^{2}}{2}}+fx-3\,gx+7\,hx-\ln \left ( 2+x \right ) d+2\,\ln \left ( 2+x \right ) e-4\,\ln \left ( 2+x \right ) f+8\,\ln \left ( 2+x \right ) g-16\,\ln \left ( 2+x \right ) h+\ln \left ( 1+x \right ) d-\ln \left ( 1+x \right ) e+\ln \left ( 1+x \right ) f-\ln \left ( 1+x \right ) g+\ln \left ( 1+x \right ) h \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((x^2-3*x+2)*(h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x)

[Out]

1/3*h*x^3+1/2*g*x^2-3/2*h*x^2+f*x-3*g*x+7*h*x-ln(2+x)*d+2*ln(2+x)*e-4*ln(2+x)*f+
8*ln(2+x)*g-16*ln(2+x)*h+ln(1+x)*d-ln(1+x)*e+ln(1+x)*f-ln(1+x)*g+ln(1+x)*h

_______________________________________________________________________________________

Maxima [A]  time = 0.705171, size = 84, normalized size = 1.27 \[ \frac{1}{3} \, h x^{3} + \frac{1}{2} \,{\left (g - 3 \, h\right )} x^{2} +{\left (f - 3 \, g + 7 \, h\right )} x -{\left (d - 2 \, e + 4 \, f - 8 \, g + 16 \, h\right )} \log \left (x + 2\right ) +{\left (d - e + f - g + h\right )} \log \left (x + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((h*x^4 + g*x^3 + f*x^2 + e*x + d)*(x^2 - 3*x + 2)/(x^4 - 5*x^2 + 4),x, algorithm="maxima")

[Out]

1/3*h*x^3 + 1/2*(g - 3*h)*x^2 + (f - 3*g + 7*h)*x - (d - 2*e + 4*f - 8*g + 16*h)
*log(x + 2) + (d - e + f - g + h)*log(x + 1)

_______________________________________________________________________________________

Fricas [A]  time = 0.259409, size = 84, normalized size = 1.27 \[ \frac{1}{3} \, h x^{3} + \frac{1}{2} \,{\left (g - 3 \, h\right )} x^{2} +{\left (f - 3 \, g + 7 \, h\right )} x -{\left (d - 2 \, e + 4 \, f - 8 \, g + 16 \, h\right )} \log \left (x + 2\right ) +{\left (d - e + f - g + h\right )} \log \left (x + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((h*x^4 + g*x^3 + f*x^2 + e*x + d)*(x^2 - 3*x + 2)/(x^4 - 5*x^2 + 4),x, algorithm="fricas")

[Out]

1/3*h*x^3 + 1/2*(g - 3*h)*x^2 + (f - 3*g + 7*h)*x - (d - 2*e + 4*f - 8*g + 16*h)
*log(x + 2) + (d - e + f - g + h)*log(x + 1)

_______________________________________________________________________________________

Sympy [A]  time = 5.44209, size = 94, normalized size = 1.42 \[ \frac{h x^{3}}{3} + x^{2} \left (\frac{g}{2} - \frac{3 h}{2}\right ) + x \left (f - 3 g + 7 h\right ) + \left (- d + 2 e - 4 f + 8 g - 16 h\right ) \log{\left (x + \frac{4 d - 6 e + 10 f - 18 g + 34 h}{2 d - 3 e + 5 f - 9 g + 17 h} \right )} + \left (d - e + f - g + h\right ) \log{\left (x + 1 \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x**2-3*x+2)*(h*x**4+g*x**3+f*x**2+e*x+d)/(x**4-5*x**2+4),x)

[Out]

h*x**3/3 + x**2*(g/2 - 3*h/2) + x*(f - 3*g + 7*h) + (-d + 2*e - 4*f + 8*g - 16*h
)*log(x + (4*d - 6*e + 10*f - 18*g + 34*h)/(2*d - 3*e + 5*f - 9*g + 17*h)) + (d
- e + f - g + h)*log(x + 1)

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.285038, size = 93, normalized size = 1.41 \[ \frac{1}{3} \, h x^{3} + \frac{1}{2} \, g x^{2} - \frac{3}{2} \, h x^{2} + f x - 3 \, g x + 7 \, h x -{\left (d + 4 \, f - 8 \, g + 16 \, h - 2 \, e\right )}{\rm ln}\left ({\left | x + 2 \right |}\right ) +{\left (d + f - g + h - e\right )}{\rm ln}\left ({\left | x + 1 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((h*x^4 + g*x^3 + f*x^2 + e*x + d)*(x^2 - 3*x + 2)/(x^4 - 5*x^2 + 4),x, algorithm="giac")

[Out]

1/3*h*x^3 + 1/2*g*x^2 - 3/2*h*x^2 + f*x - 3*g*x + 7*h*x - (d + 4*f - 8*g + 16*h
- 2*e)*ln(abs(x + 2)) + (d + f - g + h - e)*ln(abs(x + 1))